home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / CoreGateway / AtoBMailGateway.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  3.4 KB  |  117 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        AtoBMailGateway.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __ATOBMAILGATEWAY__
  15. #define __ATOBMAILGATEWAY__
  16.  
  17. #ifndef __BLJSTANDARDINCLUDES__
  18. #include "BLJStandardIncludes.h"
  19. #endif
  20.  
  21. #ifndef    __MAILGATEWAY__
  22. #include "MailGateway.h"
  23. #endif
  24.  
  25. #ifndef __HFSTUPLEDATABASE__
  26. #include "HFSTupleDatabase.h"
  27. #endif
  28.  
  29. class THalfGateway;
  30.  
  31. /***********************************|****************************************/
  32.  
  33. class TAtoBMailGateway : public TMailGateway 
  34. {
  35. public:
  36.                         TAtoBMailGateway ( THalfGateway *a, THalfGateway *b, short vRefNum, long parID );
  37.     virtual             ~TAtoBMailGateway();
  38.  
  39.     //    This sets the gateway up and gets it ready to start running.
  40.     virtual Boolean Setup ( short vRefNum, long dirID, const char* serverName );    //    this will load the named configuration
  41.  
  42.     //    This 'starts' the gateway off and running.
  43.     virtual Boolean Run(void);
  44.  
  45.     //    This prepares the gateway to shut down.  The gateway won't be fully shut down until the
  46.     //    ReadyToShutDown() returns true.
  47.     virtual Boolean PrepareToShutDown(long inHowManySeconds);
  48.     virtual Boolean    ReadyToShutDown(void);
  49.     virtual Boolean CancelGatewayShutdown (void);
  50.     virtual Boolean ShutDown(void);
  51.     
  52.     //    These deal with sending a letter from the local system to the remote system.
  53.     virtual Boolean ReceiveLetter (TLetter *letter, THalfGateway *originatorHalfGateway);
  54.     virtual Boolean RereceiveLetter(TLetter* letter, THalfGateway* originatorHalfGateway);
  55.  
  56.     //
  57.     //    CONFIGURATION / SETUP METHODS
  58.     //    =============================
  59.     //
  60.     virtual Boolean                    GetConfigItem(const ATupleKey& key, ADataItem& );
  61.     virtual Boolean                    SetConfigItem(const ATupleKey& key, const ADataItem& );
  62.     virtual Boolean                    DeleteConfigItem(const ATupleKey& key);
  63.     virtual Boolean                    GetNthConfigKey(unsigned long index, ATupleKey& key);
  64.     
  65.     //
  66.     //    STATUS REPORTING / ERROR REPORTING OPTIONS
  67.     //    ==========================================
  68.     //
  69.     virtual Boolean                    GetStatusItem(const ATupleKey& key, ADataItem& );
  70.     virtual Boolean                    SetStatusItem(const ATupleKey& key, const ADataItem& );
  71.     
  72. protected:
  73.             THFSTupleDatabase        fConfigurationDB;
  74.             THFSTupleDatabase        fStatusDB;
  75.             THalfGateway*            fAHalfGateway;
  76.             THalfGateway*            fBHalfGateway;
  77. };
  78.  
  79. /***********************************|****************************************/
  80. /***********************************|****************************************/
  81.  
  82. #pragma segment TAtoBMailGateway
  83.  
  84. inline Boolean 
  85. TAtoBMailGateway::GetConfigItem(const ATupleKey& key, ADataItem& data ) 
  86. {
  87.     return fConfigurationDB.GetTupleData ( key, data );
  88. }
  89.  
  90. /***********************************|****************************************/
  91.  
  92. inline Boolean 
  93. TAtoBMailGateway::SetConfigItem(const ATupleKey& key, const ADataItem& data ) 
  94. {
  95.     return fConfigurationDB.SetTuple ( key, data );
  96. }
  97.  
  98. /***********************************|****************************************/
  99.  
  100. inline Boolean 
  101. TAtoBMailGateway::DeleteConfigItem(const ATupleKey& key) 
  102. {
  103.     return fConfigurationDB.DeleteTuple( key );
  104. }
  105.  
  106. /***********************************|****************************************/
  107.  
  108. inline Boolean 
  109. TAtoBMailGateway::GetNthConfigKey(unsigned long index, ATupleKey& key) 
  110. {
  111.     return fConfigurationDB.GetTupleKey ( index, key );
  112. }
  113.         
  114. /***********************************|****************************************/
  115.  
  116. #endif    // __ATOBMAILGATEWAY__
  117.